import request from '@/utils/request'

// 查询校区
export function getCampusList (data) {
  return request({
    url: '/campus/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增校区
export function addCampus (data) {
  return request({
    url: '/campus/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改校区
export function updateCampus (data) {
  return request({
    url: '/campus/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除校区
export function deleteCampus (data) {
  return request({
    url: '/campus/delete',
    method: 'post',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}